<?php
	session_start();
	error_reporting(0);
	
	$username=$_SESSION['username'];
	 $uid=$_SESSION['adminid'];
	
	if($uid=='')
	{
		header("location:index.php");
	}
	include("include/header.php");
	include("include/config.php");
	include("include/functions.php");
	
?>
<div class="container-fluid">
	<div class="row-fluid">
		<?php
			include("include/sidebar.php");
		?>		
		<?php
			if($_GET['data']=='landingpage' || $_GET['data']==''){
				include("homepage.php");
			}
			
			/* projects*/
			if($_GET['data']=='projects'){
				$page = mysqli_query($db_connect,"select * from cns_projects");
				include("projects.php");
			}
			
			if($_GET['data']=='addproject'){
				$pages = mysqli_query($db_connect,"select * from cns_projects");
				
				include("addproject.php");
			}
			
			if($_GET['data']=='editproject'){
				$pages = get_table_data(DB_PREFIX.'projects',array('id !'=>$_GET['page']));
				$page1 =  mysqli_query($db_connect, "select * from cns_projects where id = '$_GET[page]'");
				$page = mysqli_fetch_array($page1);
				include("addproject.php");
			}
			/*Pages*/
			/* pages*/
			if($_GET['data']=='pages'){
				$page = mysqli_query($db_connect,"select * from cns_pages");
				
				include("pages.php");
			}
			
			if($_GET['data']=='editpage'){
				$pages = get_table_data(DB_PREFIX.'pages',array('id !'=>$_GET['page']));
				$page1 =  mysqli_query($db_connect, "select * from cns_pages where id = '$_GET[page]'");
				$page = mysqli_fetch_array($page1);
				include("addpage.php");
			}
			
			/**gallary**/
			if($_GET['data']=='gallary'){
				include("gallary.php");
			}
			if($_GET['data']=='addgallary'){
				include("addgallary.php");
			}
			
			
			
			
			/* Home Page */
			
			if($_GET['data']=='homepage'){
				$page = get_table_data(DB_PREFIX.'homepage',null);
			
				include("homepage.php");
			}
			
		
			if($_GET['data']=='contactpage'){
				$page = get_table_data(DB_PREFIX.'contact',null);
			
				include("contactpage.php");
			}
		
			
			if($_GET['data']=='settings'){
			
				$global1 = mysqli_query($db_connect, "select * from cns_globalsettings");
				$global = mysqli_fetch_array($global1);
			
				include("settings.php");
			}
		
		?>
	</div>
	<?php
		include("include/footer.php");
	?>
</div>
